Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding dp prototype #68

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

adding dp prototype #68

wants to merge 1 commit into from

Conversation

stevenbrix
Copy link
Collaborator

prototype for how we can model dependency properties after Published via a property wrapper. At the same time, also using the Swift typesystem to ensure Style's and Setters are constructed properly

a few things on the design:

  1. In order to properly subscribe to events, we need access to self in the property wrappers projectedValue. As far as i can tell, there is no way to do this. And since I cannot access self inline with the definition of the property, i have to initialize the wrapper in the initializer of the classes.
  2. Style and Setter are generic so that we can specialize who they are applied to. However, there are properties in WinUI which take a type-erased Style type. There is no compile-time validation that you are applying the correct style to an object. However, the WinUI runtime does do this at the time that the property is set.

See the readme and tests for usage

@stevenbrix stevenbrix requested a review from hurshagrawal July 7, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant